package com.citcc.business.bean;

import com.citcc.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

public class UserOrderEntity implements Serializable {
    /**
     * 主键id
     */
    private String id;

    /**
     * 支付类型（回调根据类型判断）
     */
    private String type;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 支付状态（0：待支付，1;支付中2：成功3;失败）
     */
    private String payState;

    /**
     * 交易流水号
     */
    private String tradeNo;

    /**
     * 内部订单号
     */
    private String outTradeNo;

    /**
     * 支付时间
     */
    private Date payTime;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 修改人
     */
    private String updateBy;

    /**
     * 备注
     */
    private String remark;

    /**
     * 0:未删除 1:删除
     */
    private String delFlag;
    /**
     * 桩号
     */
    @Excel(name = "桩号")
    private String stakeCode;
    /**
     * 枪号
     */
    @Excel(name = "充电枪号",readConverterExp = "1=A,2=B,null=")
    private String gunCode;

    /**
     * 充电站名称
     */
    @Excel(name = "站名")
    private String stationName;

    /**
     * 充电模式（1:按时间冲）
     */
    @Excel(name = "充电模式",readConverterExp = "0=自动充电,2=时间模式,1=金额模式,null=")
    private String chargeMs;
    /**
     * 开始时间
     */
    @Excel(name = "开始时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    /**
     * 计划结束时间
     */
    //@Excel(name = "计划结束时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTimePlan;
    /**
     * 结束时间
     */
    @Excel(name = "实际结束时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
    /**
     * 结束方式
     */
    @Excel(name = "结束方式",readConverterExp = "1=开机下发停止,2=SOC达到设定值,3=在线刷卡停止,4=离线刷卡停止,5=U3板停止充电," +
            "6=到达预设时间,7=到达预设金额,8=到达预设电量," +
            "9=余额不足,10=服务器下发,11=发生故障停止,12=手动停止充电,20=通讯故障null=")
    private String endType;

    /**
     * 充电状态（0:充电中 1:未充电 2:已完成）
     */
    @Excel(name = "状态",readConverterExp = "0=充电中,1=未充电,2=已完成,null=")
    private String chargeState;

    /**
     * 充电电能
     */
    @Excel(name = "充电电量")
    private String chargeDn;
    /**
     * 充电时长
     */
    @Excel(name = "充电时长")
    private BigDecimal chargeLong;

    /**
     * 用户手机号
     */
    @Excel(name = "用户手机号")
    private String userPhone;
    /**
     * 支付总金额
     */
    @Excel(name = "实付金额")
    private BigDecimal payNumber;

    /**
     * 应付金额
     */
    @Excel(name = "应付金额")
    private BigDecimal payNumberPlan;
    /**
     * 优惠方式
     */
    @Excel(name = "优惠方式")
    private String offType;
    /**
     * 支付类型（0;zfb 1:wx 2:xcx）
     */
    @Excel(name = "支付方式",readConverterExp = "0=app支付,1=微信,2=支付宝,null=")
    private String payType;
    /**
     * 优惠金额
     */
    private BigDecimal offMoney;

    /**
     * 站号
     */
    private String stationCode;

    /**
     * 充电类型 1:直流 2:交流 3:混合
     */
    private String chargeType;

    /**
     * 充电标准
     */
    private String chargeStandard;

    /**
     * 功率
     */
    private String chargePower;

    /**
     * 电压
     */
    private String chargeDy;

    /**
     * 充电费用
     */
    private BigDecimal chargeMoney;

    /**
     * 服务费用
     */
    private BigDecimal chargeFw;

    /**
     * 停车费用
     */
    private BigDecimal chargeTc;
    /**
     * 退款金额
     */
    private BigDecimal refundPrice;
    /**
     * 退款状态
     */
    private String state;
    /**
     * 退款状态
     */
    private String refundReason;
    private String orgId;

    private String orgName;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date beginTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date stopTime;

    private String value;

    /**
     * 实付金额
     */
    private BigDecimal money;

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public BigDecimal getOffMoney() {
        if(offMoney!=null){
            return offMoney.setScale(2,BigDecimal.ROUND_HALF_UP);
        }else{
            return offMoney;
        }
    }
    public void setOffMoney(BigDecimal offMoney) {
        this.offMoney = offMoney;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }


    private static final long serialVersionUID = 1L;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType == null ? null : payType.trim();
    }

    public String getPayState() {
        return payState;
    }

    public void setPayState(String payState) {
        this.payState = payState == null ? null : payState.trim();
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo == null ? null : tradeNo.trim();
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo == null ? null : outTradeNo.trim();
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public BigDecimal getPayNumber() {
        return payNumber;
    }

    public void setPayNumber(BigDecimal payNumber) {
        this.payNumber = payNumber;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy == null ? null : createBy.trim();
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy == null ? null : updateBy.trim();
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag == null ? null : delFlag.trim();
    }

    public String getGunCode() {
        return gunCode;
    }

    public void setGunCode(String gunCode) {
        this.gunCode = gunCode == null ? null : gunCode.trim();
    }

    public String getStakeCode() {
        return stakeCode;
    }

    public void setStakeCode(String stakeCode) {
        this.stakeCode = stakeCode == null ? null : stakeCode.trim();
    }

    public String getStationCode() {
        return stationCode;
    }

    public void setStationCode(String stationCode) {
        this.stationCode = stationCode == null ? null : stationCode.trim();
    }

    public String getChargeType() {
        return chargeType;
    }

    public void setChargeType(String chargeType) {
        this.chargeType = chargeType == null ? null : chargeType.trim();
    }

    public String getChargeStandard() {
        return chargeStandard;
    }

    public void setChargeStandard(String chargeStandard) {
        this.chargeStandard = chargeStandard == null ? null : chargeStandard.trim();
    }

    public String getChargePower() {
        return chargePower;
    }

    public void setChargePower(String chargePower) {
        this.chargePower = chargePower == null ? null : chargePower.trim();
    }

    public String getChargeDy() {
        return chargeDy;
    }

    public void setChargeDy(String chargeDy) {
        this.chargeDy = chargeDy == null ? null : chargeDy.trim();
    }

    public BigDecimal getChargeMoney() {
        return chargeMoney;
    }

    public void setChargeMoney(BigDecimal chargeMoney) {
        this.chargeMoney = chargeMoney;
    }

    public BigDecimal getChargeFw() {
        return chargeFw;
    }

    public void setChargeFw(BigDecimal chargeFw) {
        this.chargeFw = chargeFw;
    }

    public BigDecimal getChargeTc() {
        return chargeTc;
    }

    public void setChargeTc(BigDecimal chargeTc) {
        this.chargeTc = chargeTc;
    }

    public String getChargeMs() {
        return chargeMs;
    }

    public void setChargeMs(String chargeMs) {
        this.chargeMs = chargeMs == null ? null : chargeMs.trim();
    }

    public BigDecimal getChargeLong() {
        return chargeLong;
    }

    public void setChargeLong(BigDecimal chargeLong) {
        this.chargeLong = chargeLong;
    }

    public String getChargeState() {
        return chargeState;
    }

    public void setChargeState(String chargeState) {
        this.chargeState = chargeState == null ? null : chargeState.trim();
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone == null ? null : userPhone.trim();
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName == null ? null : stationName.trim();
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Date getEndTimePlan() {
        return endTimePlan;
    }

    public void setEndTimePlan(Date endTimePlan) {
        this.endTimePlan = endTimePlan;
    }

    public String getChargeDn() {
        return chargeDn;
    }

    public void setChargeDn(String chargeDn) {
        this.chargeDn = chargeDn;
    }

    public String getEndType() {
        return endType;
    }

    public void setEndType(String endType) {
        this.endType = endType;
    }

    public String getOffType() {
        return offType;
    }

    public void setOffType(String offType) {
        this.offType = offType;
    }

    public BigDecimal getPayNumberPlan() {
        if(payNumberPlan!=null){
            return payNumberPlan.setScale(2,BigDecimal.ROUND_HALF_UP);
        }else{
            return payNumberPlan;
        }
    }

    public void setPayNumberPlan(BigDecimal payNumberPlan) {
        this.payNumberPlan = payNumberPlan;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public Date getStopTime() {
        return stopTime;
    }

    public void setStopTime(Date stopTime) {
        this.stopTime = stopTime;
    }

    public BigDecimal getRefundPrice() {
        return refundPrice;
    }

    public void setRefundPrice(BigDecimal refundPrice) {
        this.refundPrice = refundPrice;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getRefundReason() {
        return refundReason;
    }

    public void setRefundReason(String refundReason) {
        this.refundReason = refundReason;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", type=").append(type);
        sb.append(", userId=").append(userId);
        sb.append(", payType=").append(payType);
        sb.append(", payState=").append(payState);
        sb.append(", tradeNo=").append(tradeNo);
        sb.append(", outTradeNo=").append(outTradeNo);
        sb.append(", payTime=").append(payTime);
        sb.append(", payNumber=").append(payNumber);
        sb.append(", createTime=").append(createTime);
        sb.append(", createBy=").append(createBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", remark=").append(remark);
        sb.append(", delFlag=").append(delFlag);
        sb.append(", gunCode=").append(gunCode);
        sb.append(", stakeCode=").append(stakeCode);
        sb.append(", stationCode=").append(stationCode);
        sb.append(", chargeType=").append(chargeType);
        sb.append(", chargeStandard=").append(chargeStandard);
        sb.append(", chargePower=").append(chargePower);
        sb.append(", chargeDy=").append(chargeDy);
        sb.append(", chargeMoney=").append(chargeMoney);
        sb.append(", chargeFw=").append(chargeFw);
        sb.append(", chargeTc=").append(chargeTc);
        sb.append(", chargeMs=").append(chargeMs);
        sb.append(", chargeLong=").append(chargeLong);
        sb.append(", chargeState=").append(chargeState);
        sb.append(", userPhone=").append(userPhone);
        sb.append(", stationName=").append(stationName);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", endTimePlan=").append(endTimePlan);
        sb.append(", chargeDn=").append(chargeDn);
        sb.append(", endType=").append(endType);
        sb.append(", payNumberPlan=").append(payNumberPlan);
        sb.append(", offType=").append(offType);
        sb.append(", refundPrice=").append(refundPrice);
        sb.append(", state=").append(state);
        sb.append(", refundReason=").append(refundReason);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

}